From: Florian Müllner Date: Wed, 8 Mar 2023 03:48:05 +0000 (+0100) Subject: panelMenu: Fix keynav of menu-less buttons X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~371^2^2~32 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ecb274cee066591591127e03e10a582e9f2c0397;p=gnome-shell.git panelMenu: Fix keynav of menu-less buttons The left/right navigation between top bar buttons is usually handled by a key-press handler on the button's menu. However when a DummyMenu is used, the button itself serves as fake menu actor and will get grabbed when "opening" the menu. Due to that grab, the event is not propagated to the stage, and regular keynav does not work. To avoid the focus getting stuck in that case, add an explicit key-press handler that bypasses the grab. Part-of: --- diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js index 75b6ba5f5..a5445ce87 100644 --- a/js/ui/panelMenu.js +++ b/js/ui/panelMenu.js @@ -108,6 +108,9 @@ var Button = GObject.registerClass({ this.menu = new PopupMenu.PopupDummyMenu(this); else this.setMenu(new PopupMenu.PopupMenu(this, menuAlignment, St.Side.TOP, 0)); + + this.connect('key-press-event', + (o, ev) => global.focus_manager.navigate_from_event(ev)); } setSensitive(sensitive) {